#include "GameStateManager.h"

GameStateManager::GameStateManager( void ) : Singleton<GameStateManager>()
{

}

void GameStateManager::addGameState( GameState * state )
{
    m_gameStates.push_back( state );
}

void GameStateManager::popGameState( void )
{
    delete m_gameStates[ 0 ];
    m_gameStates.erase( m_gameStates.begin() );
}

void GameStateManager::run( void )
{
    while( m_gameStates.size() > 0 )
    {
        (*m_gameStates[ 0 ]).run();
        popGameState();
    }
}


